﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 图书借阅系统
{
    public partial class 管理员登录 : System.Web.UI.Page
    {
        string s = System.Configuration.ConfigurationManager.ConnectionStrings["Connection"].ConnectionString;
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(s);
            string userId = TextBox1.Text.Trim();
            string userPwd = TextBox2.Text.Trim();
            if (userId == "000" && userPwd== "123456")
            {
                Response.Redirect("管理员.aspx");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('工号或密码输入错误，请检查！');</script>"); 
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("系统主页.aspx");
        }
    }
}